package com.java.reflect;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Method;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@interface ApiImplicitParam{ //默认继承Annotation接口
     String name() default "";
     String value() default "";
     String dataType() default "int";
}
class XxxController{
    @ApiImplicitParam(name = "page", value = "页码", dataType = "int")
    public void doSelect(){}
}
public class AnnotationTests {
    public static void main(String[] args) throws NoSuchMethodException {
        Class<XxxController> xxxControllerClass = XxxController.class;
        Method doSelect = xxxControllerClass.getDeclaredMethod("doSelect");
        ApiImplicitParam annotation = doSelect.getAnnotation(ApiImplicitParam.class);
        String name = annotation.name();
        String value = annotation.value();
        String dataType = annotation.dataType();
        System.out.println(name+"/"+value+"/"+dataType);
    }
}
